<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html lang="en">
<head>
    <%@include file="/WEB-INF/pages/common/head.jsp"%>
</head>
<body>
    <div class="container-fluid">
        <div class="panel panel-info">
            <div class="panel-heading">
                <h4>查询条件</h4>
                <a class="caret pull-right" data-toggle="collapse" href="#content"></a>
            </div>
            <div id="content" class="panel-collapse collapse in">
                <div class="panel-body">
                    <form id="condition"  class="form-inline">
                        <div class="row">
                            <div class="panel-group col-md-4">
                                <label for="loginName">登录名:</label>
                                <input type="text" id="loginName" name="loginName" class="form-control" placeholder="登录名"/>

                            </div>
                            <div class="panel-group col-md-4">
                                <label for="userName">姓名:</label>
                                <input type="text" id="userName" name="userName" class="form-control" placeholder="姓名"/>
                            </div>
                            <div class="panel-group col-md-4">
                                <label for="role">角色:</label>
                                <select class="form-control" id="role" name="roleCode">
                                    <option value="">全部</option>
                                    <c:forEach items="${roles}" var="r">
                                        <option value="${r.roleCode}">${r.roleName}</option>
                                    </c:forEach>
                                </select>
                            </div>
                        </div>
                        <div class="row">
                            <div class="panel-group col-md-4">
                                <label for="hospital">医院名称:</label>
                                <select class="form-control" id="hospital" name="hospitalCode">
                                    <option value="">全部</option>
                                    <c:forEach items="${hospitals}" var="h">
                                        <option value="${h.hospitalCode}">${h.hospitalName}</option>
                                    </c:forEach>
                                </select>
                            </div>
                            <div class="panel-group col-md-4">
                                <label for="branch">分院名称:</label>
                                <select class="form-control" id="branch" name="branchCode">
                                    <option value="">全部</option>
                                    <c:forEach items="${branchs}" var="b">
                                        <option value="${b.branchCode}">${b.branchName}</option>
                                    </c:forEach>
                                </select>
                            </div>
                            <div class="panel-group col-md-4">
                                <label for="department">科室名称:</label>

                                <select  class="form-control" id="department" name="departmentCode">
                                    <option value="">全部</option>
                                    <c:forEach items="${departments}" var="d">
                                        <option value="${d.departmentCode}">${d.departmentName}</option>
                                    </c:forEach>
                                </select>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-10"></div>
                            <div class="col-md-2">
                                <button class="btn btn-primary" type="button" onclick="searchTjUser()">查询</button>
                                <button class="btn btn-primary" type="button" onclick="addUser()">新增</button>
                            </div>

                        </div>

                    </form>
                </div>
            </div>
        </div>
        <table id="table" data-toggle="table"
               data-pagination="true"
               data-side-pagination="server"
               data-url="sys/user/searchPager"
        data-toolbar-algin="right"
               data-align="center"
        >
            <thead>
                <tr>
                    <th data-field="userId">序号</th>
                    <th data-field="loginName">登录名</th>
                    <th data-field="userName">姓名</th>
                    <th data-field="hospitalCode" data-formatter="FormatHospital">医院</th>
                    <th data-field="branchCode" data-formatter="FormatBranch">分院</th>
                    <th data-field="departmentCode" data-formatter="FormatDepartment">科室</th>
                    <th data-field="roleCode" data-formatter="FormatRole">角色</th>
                    <th data-field="loginFlag" data-formatter="FormatState">登录状态</th>
                    <th data-field="email">电子邮件</th>
                    <th data-field="phoneNo">电话号码</th>
                    <th data-field="mobileNo">手机</th>
                    <th data-formatter="FormatOperation">操作</th>
                </tr>
            </thead>
        </table>
    </div>

    <div class="hidden" id="UpUser">
        <form id="updateUser"  class="form-horizontal">
            <div class="row">

                <div class="form-group col-md-4">
                    <label for="">登录名:</label>
                    <input type="text"  name="loginName" class="form-control" disabled="disabled"/>
                    <input type="hidden" name="userId" class="form-control"/>
                </div>
                <div class="form-group col-md-4">
                    <label for="">密码:</label>
                    <input type="password"  name="password" class="form-control"/>
                </div>
                <div class="form-group col-md-4">
                    <label for="">姓名:</label>
                    <input type="text"  name="userName" class="form-control"/>
                </div>
            </div>
            <div class="row">
                <div class="form-group col-md-4">
                    <label for="">医院名称:</label>
                    <input type="text" class="form-control" name="hospital" disabled="disabled">
                </div>
                <div class="form-group col-md-4">
                    <label for="">分院名称:</label>
                    <input type="text" class="form-control" name="branch" disabled="disabled">
                </div>
                <div class="form-group col-md-4">
                    <label for="">科室名称:</label>
                    <input type="text" class="form-control" name="department" disabled="disabled">
                </div>
            </div>
            <div class="row">
                <div class="form-group col-md-4">
                    <label for="">角色:</label>
                    <select class="form-control"  name="roleCode">
                        <c:forEach items="${roles}" var="r">
                            <option value="${r.roleCode}">${r.roleName}</option>
                        </c:forEach>
                    </select>
                </div>
                <div class="form-group col-md-4">
                    <label for="">登录状态:</label>
                    <select class="form-control"  name="loginFlag">
                        <option value="y">可以登录</option>
                        <option value="n">不可登录</option>
                    </select>
                </div>
                <div class="form-group col-md-4">
                    <label for="">邮箱:</label>
                    <input type="text" class="form-control" name="email">
                </div>
            </div>
            <div class="row">
                <div class="form-group col-md-4">
                    <label for="">电话:</label>
                    <input type="text" class="form-control" name="phoneNo">
                </div>
                <div class="form-group col-md-4">
                    <label for="">手机:</label>
                    <input type="text" class="form-control" name="mobileNo">
                </div>
                <div class="form-group col-md-4">

                </div>
            </div>
            <div class="row">
                <div class="col-md-8">
                    <label for="">备注:</label>
                    <textarea name="remarks" id="" cols="30" rows="3" ></textarea>
                </div>
                <div class="col-md-4">

                </div>
            </div>


        </form>
    </div>

    <div class="hidden" id="AddUser">
        <form id="adUser"  class="form-horizontal">
            <div class="row">

                <div class="form-group col-md-4">
                    <label for="">登录名:</label>
                    <input type="text"  name="loginName" class="form-control" />
                </div>
                <div class="form-group col-md-4">
                    <label for="">密码:</label>
                    <input type="password"  name="password" class="form-control"/>
                </div>
                <div class="form-group col-md-4">
                    <label for="">姓名:</label>
                    <input type="text"  name="userName" class="form-control"/>
                </div>
            </div>
            <div class="row">
                <div class="form-group col-md-4">
                    <label for="">医院名称:</label>
                    <select class="form-control" name="hospitalCode">
                        <c:forEach items="${hospitals}" var="h">
                            <option value="${h.hospitalCode}">${h.hospitalName}</option>
                        </c:forEach>
                    </select>
                </div>
                <div class="form-group col-md-4">
                    <label for="">分院名称:</label>
                    <select class="form-control" name="branchCode">
                        <c:forEach items="${branchs}" var="b">
                            <option value="${b.branchCode}">${b.branchName}</option>
                        </c:forEach>
                    </select>
                </div>
                <div class="form-group col-md-4">
                    <label for="">科室名称:</label>
                    <select  class="form-control" name="departmentCode">
                        <c:forEach items="${departments}" var="d">
                            <option value="${d.departmentCode}">${d.departmentName}</option>
                        </c:forEach>
                    </select>
                </div>
            </div>
            <div class="row">
                <div class="form-group col-md-4">
                    <label for="">角色:</label>
                    <select class="form-control"  name="roleCode">
                        <c:forEach items="${roles}" var="r">
                            <option value="${r.roleCode}">${r.roleName}</option>
                        </c:forEach>
                    </select>
                </div>
                <div class="form-group col-md-4">
                    <label for="">登录状态:</label>
                    <select class="form-control"  name="loginFlag">
                        <option value="y">可以登录</option>
                        <option value="n">不可登录</option>
                    </select>
                </div>
                <div class="form-group col-md-4">
                    <label for="">邮箱:</label>
                    <input type="text" class="form-control" name="email">
                </div>
            </div>
            <div class="row">
                <div class="form-group col-md-4">
                    <label for="">电话:</label>
                    <input type="text" class="form-control" name="phoneNo">
                </div>
                <div class="form-group col-md-4">
                    <label for="">手机:</label>
                    <input type="text" class="form-control" name="mobileNo">
                </div>
                <div class="form-group col-md-4">

                </div>
            </div>
            <div class="row">
                <div class="col-md-8">
                    <label for="">备注:</label>
                    <textarea name="remarks" id="" cols="30" rows="3" ></textarea>
                </div>
                <div class="col-md-4">

                </div>
            </div>


        </form>
    </div>
<%@include file="/WEB-INF/pages/common/modal.jsp"%>
<script src="res/js/user.js"></script>
</body>
</html>